// Domain/Events/MenuEvents.cs
using UniversalAdmin.Domain.Entities;

namespace UniversalAdmin.Domain.Events;

public abstract record MenuEvent : DomainEvent
{
  public virtual int MenuId { get; init; }
  public virtual string MenuName { get; init; } = null!;
}

public record MenuCreatedEvent(Menu Menu) : MenuEvent
{
  public override int MenuId => Menu.Id;
  public override string MenuName => Menu.Name;
}

public record MenuUpdatedEvent(Menu Menu) : MenuEvent
{
  public override int MenuId => Menu.Id;
  public override string MenuName => Menu.Name;
}

public record MenuDeletedEvent(int DeletedMenuId, string DeletedMenuName) : MenuEvent
{
  public override int MenuId => DeletedMenuId;
  public override string MenuName => DeletedMenuName;
}

public record MenuSortChangedEvent(Menu Menu, int OldSort) : MenuEvent
{
  public override int MenuId => Menu.Id;
  public override string MenuName => Menu.Name;
  public int NewSort => Menu.Sort;
}